﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	
	<script src="../../js/scripts/boot.js" type="text/javascript"></script>
	<link href="../../js/scripts/miniui/themes/blue/skin.css" rel="stylesheet" type="text/css" />
	
	<style type="text/css">
		html, body {
			margin: 0;
			padding: 0;
			border: 0;
			width: 100%;
			height: 100%;
			overflow: hidden;
		}
	</style>
</head>
<body>

<form id="form1">
	<div style="padding-left:11px;padding-bottom:5px;">
		<table>
			<tr>
				<td align="center" width="10%">项目名称</td>
				<td width="23%">
					<input id="name" name="name" required="true" class="mini-textbox" style="width: 100%; display: inline-block;" />
				</td>
<!-- 				<td align="center" width="10%">文档类型</td>
				<td width="23%">
					<input name="type" id="docType" class="mini-combobox"
					 data='[{ "id": "usa", "text": "开发进度周报" }, { "id": "cn", "text": "项目开发总结" }]'
					 value="cn" textField="text" valueField="id" style="width: 100%; display: inline-block;" />
				</td> -->
				<td align="center">所属部门</td>
				<td><input id=projectName name="projectName" class="mini-textbox"
					style="width: 100%; display: inline-block;" /></td>
			</tr>
			<tr>
				<td align="center">保密级别</td>
				<td><input id="level" name="level" class="mini-combobox"
					data='[{ "id": "1", "text": "一星" }, { "id": "2", "text": "二星" },{ "id": "3", "text": "三星" }]'
					value="1" textField="text" valueField="id" style="width: 100%; display: inline-block;" />
				</td>
			</tr>
		</table>
	</div>
    <div style="text-align:center;padding:10px;">               
           <a class="mini-button" onclick="onOk" style="width:60px;margin-right:20px;">确定</a>       
           <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>       
    </div>
</form>


	<script type="text/javascript">
		mini.parse();
		var userType = '<%= session.getAttribute("userType")%>';
		var type = mini.get("docType");

        var form = new mini.Form("form1");
        function CloseWindow(action) {            
            if (action == "close" && form.isChanged()) {
                if (confirm("数据被修改了，是否先保存？")) {
                    return false;
                }
            }
            if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
            else window.close();            
        }
        
        function onOk() {
            //提交表单数据
            var form = new mini.Form("#form1"); 
            
            form.validate();
            if (form.isValid() == false) return;
            
            var data = form.getData();      //获取表单多个控件的数据
           // var json = mini.encode(data);   //序列化成JSON
           
            $.ajax({
                url: "/document/doc/saveDocInfo.do",
                type: "post",
                data: data,
	            success: function (text) {
	                CloseWindow("save");
	            },
	            error: function (jqXHR, textStatus, errorThrown) {
	                alert(jqXHR.responseText);
	                CloseWindow();
	            }

            });
        }
        
        function onCancel(e) {
            CloseWindow("cancel");
        }
        
        function SetData(data) {

        }
        function GetData() {
            var o = form.getData();
            return o;
        }

	</script>

</body>
</html>